home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 184 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.cis.nctu.edu.tw!usenet
  2. From: terryt@mcs.com (Terry Trippany)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: VC++: AppWizard without standard menu/toolbar
  5. Date: 3 Jan 1996 00:16:59 GMT
  6. Organization: STR
  7. Message-ID: <4cchtr$6j2@news.cis.nctu.edu.tw>
  8. References: <4c1keu$7ed@walrus2.walrus.com>
  9. NNTP-Posting-Host: @terryt.pr.mcs.net
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14. In article <4c1keu$7ed@walrus2.walrus.com>, sharpe@walrus.com says...
  15. >
  16. >Hello everyone,
  17. >
  18. >  I have a question, that is begging for an answer. I am using Visual C++ 
  19. v4.0's
  20. >AppWizard to get a SDI window. I need to know, how can I have the AppWizard
  21. >NOT include the standard menu and toolbar (File, Edit, View etc.) ? The result 
  22. should
  23. >be a blank window, with a title bar only. If not, how can I delete them 
  24. without disturbing it
  25. >or doing it manually ? Thanks in advance.
  26. >
  27. >
  28. >Jamiel Humayun
  29. >Sharpe Capital, Inc.
  30.  
  31. Jamiel,
  32.  
  33.   Hello, this an be done by overriding the CFrameWnd::PreCreateWindow() member 
  34. function as follows:
  35.  
  36.  
  37. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  38. {
  39.     // TODO: Modify the Window class or styles here by modifying
  40.     //  the CREATESTRUCT cs
  41.  
  42.       if(cs.hMenu!=NULL)
  43.       {
  44.           DestroyMenu(cs.hMenu);      
  45.           cs.hMenu = NULL;           
  46.       }
  47.  
  48.       return CFrameWnd::PreCreateWindow(cs);
  49. }
  50.  
  51. - you can also do the same with the style bits to alter the start appearance or 
  52. do things like
  53. eliminate the system menu.
  54.  
  55. Good luck,
  56.  
  57. Terry Trippany
  58. terryt@mcs.com
  59. Strategic Technology Resources
  60. Chicago, IL
  61.  
  62.  
  63.